package com.yc.yjh.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    int  code;
    String msg;
    Object data;

    public static Result success(String msg){
        return new Result(1,msg,null);
    }
    public static Result success(String msg,Object data){
        return new Result(1,msg,data);
    }
    public static Result error(String msg){
        return new Result(0,msg,null);
    }
    public static Result error(int code,String msg){
        return new Result(code,msg,null);
    }
}
